package com.zhoust.fastdome.emnu;

import com.zhoust.fastdome.exception.BusinessException;

/**
 * @author zhoust
 * @Date 2021/9/8 21:16
 * @Desc <TODO DESC>
 */
public enum ExceptionEnum {

    BUSINESS_NOT_ONE("400","id为1的数据不支持查询"),
    ERR_NOT_LOOK("401","长得太帅不让看"),
    // 往后面累加...
    ;

    private String code;
    private String desc;

    ExceptionEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }
    public void ThrowException(){
        ThrowException(code,desc);
    }
    public void ThrowException(String errMassage){
        errMassage = desc +":"+errMassage;
        ThrowException(code,errMassage);
    }
    private BusinessException ThrowException(String code,String desc){
        throw new BusinessException(code,desc);
    }
}
